{% extends "base.html" %}

{% block content %}
<div class="container-xl py-4">
    <!-- 顶部返回按钮 -->
    <div class="d-flex justify-content-between align-items-center mb-4">
        <h2 class="page-title"><i class="fas fa-info-circle"></i> 设备详情</h2>
        <a href="{{ url_for('dashboard') }}" class="btn btn-secondary">
            <i class="fas fa-arrow-left"></i> 返回主页
        </a>
    </div>

    <!-- 设备信息卡片 -->
    <div class="card">
        <div class="card-body">
            <div class="row">
                <!-- 设备照片 -->
                <div class="col-md-4">
                    {% if equipment.photo_path %}
                    <img src="{{ url_for('static', filename=equipment.photo_path) }}" 
                         class="img-fluid rounded" alt="设备照片">
                    {% else %}
                    <div class="text-center p-4 bg-light rounded">
                        <i class="fas fa-camera fa-3x text-muted"></i>
                        <p class="mt-2 text-muted">暂无照片</p>
                    </div>
                    {% endif %}
                </div>
                
                <!-- 设备信息 -->
                <div class="col-md-8">
                    <h4 class="mb-4">基本信息</h4>
                    <div class="row">
                        <div class="col-md-6">
                            <p><strong>SN码：</strong> {{ equipment.sn }}</p>
                            <p><strong>生产厂商：</strong> {{ equipment.manufacturer }}</p>
                            <p><strong>原网元名称：</strong> {{ equipment.original_network_element }}</p>
                            <p><strong>现网元名称：</strong> {{ equipment.current_network_element }}</p>
                        </div>
                        <div class="col-md-6">
                            <p><strong>设备类型：</strong> {{ equipment.type }}</p>
                            <p><strong>制式：</strong> {{ equipment.standard }}</p>
                            <p><strong>入库时间：</strong> {{ equipment.date }}</p>
                            <p><strong>出库时间：</strong> {{ equipment.outbound_time }}</p>
                            <p><strong>销库时间：</strong> {{ equipment.discard_time }}</p>
                            <p><strong>状态：</strong> 
                                <span class="badge {% if equipment.status == '在库' %}bg-success
                                                  {% elif equipment.status == '出库' %}bg-warning
                                                  {% else %}bg-danger{% endif %}">
                                    {{ equipment.status }}
                                </span>
                            </p>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
{% endblock %} 